package demo_10_11_01;

public class work_07 {
    public static void main(String[] args) {
        String str = "hanbasdnbafllgnbahjnbakqqqqlnbaxi";
        int ret = 0;
        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i)=='n')
            {
                if(str.substring(i,i+3).equals("nba"))
                    ret++;
            }
        }

        System.out.println(ret);
    }
}
